<?php
//author: weibo.com/10coder 

//step1.
require_once(dirname(__FILE__) . '/../api3.inc.php');

function case1() {
	
	$apns = api3('apns')->auth('test', 'test')->token(1022, 'test token')->errno($errno);
	var_dump(true === $apns->isok($errno));
	
	$apns->push(1022, 'test message')->errno($errno);
	var_dump(true === $apns->isok($errno));

}

$idx= isset($argv[1])?intval($argv[1]):0;
if($idx === 0)
while(++$idx) {
	$fun = 'case' . $idx;
	if(function_exists($fun)) $fun();
	else exit;
}

$fun = 'case' . $idx;
if(function_exists($fun)) $fun();

